local Cell = {}
function Cell:new(x, y, w, h, cellType)
	local cell = display.newRect( x, y, w, h )
	cell.x = x
	cell.y = y
	cell.w = w
	cell.h = h
	cell.damage = 0
	cell.cellType = cellType
	cell:setStrokeColor( 0, 0, 0)
	cell.strokeWidth = 1

	function cell:setSprite(sprite)
		local r, g, b = 0, 1, 0
		if sprite == 'fire' then
			r, g, b = 1, 0, 0
		end
		cell:setFillColor(r, g, b, 0.2)
	end


	function cell:changeCellType(cellType)
		if cellType == 'fire' then
			self:setSprite('fire')
			self.cellType = cellType
			self.modifyPlayerState = self.fireModifier
			self.damage = 10
		else
			self:setSprite('normal')
			self.modifyPlayerState = self.normalModifier
			self.damage = 0
		end
	end

	function cell:fireModifier(player, delta)
		player:lifeUpdate(-self.damage * delta)
		-- print (player.actualLife, self.damage)
	end
	function cell:normalModifier(player, delta)
	end

	function cell:modifyPlayerState(player)
	end
	cell:changeCellType(cellType)

	return cell
end

return Cell